This application is based on applications No. 10-195995 and No. 10-250124 filed in Japan, the contents of which are hereby incorporated by reference.
(1) Field of the Invention
The present invention relates to a document orientation recognizing device which is usually provided in an image forming apparatus such as a copier and which recognizes the orientation of an image of a document.
(2) Related Art
There have been research and development in techniques relating to copying multiple documents successively using copiers, especially digital copiers, in such a manner that recording sheets will have respective images thereon in the same orientation regardless of random orientations of documents originally having placed by a user. An example of such a technique is disclosed by Japanese Laid-Open Patent Application No. H06-103710.
When the user sets documents arranged in random orientations on the copier for successive copying operations, the orientations of images formed on the discharged recording sheets (the recording sheets on which images have been formed are referred to as the xe2x80x9ccopied sheetsxe2x80x9d hereinafter) are also random in the same way as the documents having set by the user. This means that the user has to arrange the documents in the same orientation before the copying operations or change the orientations of the copied sheets after the copying operations, and this causes great inconvenience.
To align the orientations of images formed on copied sheets, the orientation needs to be detected for each document in accordance with image data of the document (referred to as the xe2x80x9cdocument image dataxe2x80x9d) and image rotation processing may be performed when necessary. Hereinafter, the processing for judging the orientation of a document image is referred to as the xe2x80x9corientation detection processing.xe2x80x9d In most of orientation detection methods, the orientation of one character retrieved from document image data is detected and that orientation is judged as the orientation of a whole document image. The image rotation processing is performed when the orientation of the document image that has been detected through the orientation detection processing disagrees with a predetermined orientation. Specifically, the image data is rotated a necessary angle so that the orientation of the document image data agrees with the predetermined orientation. By executing image formation based on the rotated image data, the orientations of images formed on copied sheets are oriented in the same direction.
For the orientation detection processing, various methods have been suggested with the aim of increasing processing efficiency and reliability of detection results. As one example, Japanese Laid-Open Patent Application No. H09-69136 discloses a method for increasing the reliability of detection results.
The orientation detection processing is performed on a basic premise that the orientation of characters in a document is identical to the orientation of a whole document image. The aim of the method disclosed in the Application H09-69136 is to reduce detection errors which occur when the orientation detection processing is performed on exceptional characters that exist on documents.
FIGS. 1a and 1b are examples where the orientations of characters on documents do not correspond to the respective orientations of whole document images.
A character string 801 in FIG. 1a is a caption. The xe2x80x9ccaptionxe2x80x9d is appended to a graph or figure and explains what the graph or figure is about. The caption characters of the character string 801 are written horizontally in a vertical line, although a document 810 is in portrait format.
A character string 802 in FIG. 1b is composed of characters included in a table (referred to as the xe2x80x9ctable charactersxe2x80x9d hereinafter). The character string 802 is written horizontally in a vertical line, although a document 820 is in portrait format.
It can be readily understood that the orientation of the document image is incorrectly detected when the orientation detection processing is performed on the caption characters or table characters. To address this problem, the cited Application No. H09-69136 discloses a method by which the orientation detection processing based on the caption characters and table characters are avoided when possible. This method is achieved according to the following steps.
First, an image part of a document is divided into a plurality of areas. The attribute of each area is next judged. The attribute is judged to be one of xe2x80x9ctext attribute,xe2x80x9d xe2x80x9ctitle attribute,xe2x80x9d xe2x80x9ctable attribute,xe2x80x9d and xe2x80x9ccaption attribute.xe2x80x9d The text attribute and title attribute respectively indicate that a character in the area belongs to a text and a title. The table character attribute indicates that a character in the area belongs to a table, while the caption attribute indicates a character in the area belongs to the caption explaining what the figure or the like included in the document is about. According to the attribute judged for each area, priorities are respectively assigned to the areas for detecting the orientation of the document. In general, the text and title attributes take precedence over the table and caption attributes. As one example, suppose that the order of priority is text attribute xe2x86x92title attributexe2x86x92table attributexe2x86x92caption attribute. A plurality of characters are sampled from the area with the attribute of the highest priority, and the orientation detection processing is performed for each of the sample characters. When the results obtained through the orientation detection processing are the same, that is, the orientations of the sample characters judged to be the same, the orientation of those characters is judged as the orientation of the whole document image. On the other hand, when the orientations of the sample characters are different to each other, another plurality of characters are sampled from the area with the attribute of the second highest priority, and the orientation detection processing is performed for each of the sample characters.
Using this conventional technique, however, the attribute is judged for each area and the orientation detection processing is performed for each area in order of priority. This causes a considerable load. The processing performed in this way improves the precision of an orientation detection result and so is surely useful. Yet, in reality, the order of priority is fixed and the orientation detection processing is performed based on the area with the text or title attribute in most cases. The orientation detection processing may be performed based on the area with the table or caption attribute when the document has these kinds of characters only. In this case, the reliability of the orientation detection result would be low using any orientation detection method. For a document which includes both text and caption, it is likely for the orientation detection processing to be performed based on the text, not on the caption with a low priority. If there should be a case where the orientation detection processing is performed based on the caption instead of the text, the case would be very rare. Accordingly, in most cases, the load caused by the orientation detection processing performed in order of priority that is determined for the areas according to their attributes is too heavy for the effect obtained through this processing.
Meanwhile, there have been copiers which are provided with a mode where a double-page spread from a bound document such as a book is copied page by page. Hereinafter, this mode is referred to as the xe2x80x9cpage-by-page mode,xe2x80x9d and bound documents, such as books and magazines, are all referred to as xe2x80x9cbooks.xe2x80x9d This mode is used when the user makes copies of a book, turning pages one by one. Here, it should be noted that the Japanese language can be written both horizontally and vertically. When the Japanese script is written vertically, it is written from right to left. This means that a book written vertically in Japanese is read in the opposite direction to a book written horizontally. As a result, the order of the page numbers in a book written vertically in Japanese differs from a book written horizontally. More specifically, on a double-page spread, the page with a lower number comes on the right side when the book is written vertically in Japanese, while the page with a lower number comes on the left side when it is written horizontally. Therefore, the page layouts of vertically and horizontally written books are reversed. As such, when making copies of the book vertically written in Japanese, pages are not copied in the correct order. For this reason, the user has to reorder the pages after the copying operations. Moreover, when the book is placed the wrong way round on a platen glass of the copier by mistake, the user has to reorder the pages and also turn the copied sheets the right way round when necessary. This takes much time and effort. Hereinafter, a book vertically written in Japanese is referred to as the xe2x80x9cJapanese-style book.xe2x80x9d
Japanese Laid-Open Patent Application No. H09-83691 discloses a technique to address this problem. By means of this technique, when a book is copied in the page-by-page mode, it is judged from the image data obtained by reading a page of the book whether the book is written vertically or horizontally and whether the book is the right way up. In accordance with the judgement result, the order in which two pages on a spread are copied is changed and the image data is rotated when necessary. As a result, the copying operations are performed in the correct page order, and all of the orientations of the images formed on the copied sheets are the same.
Using this technique, however, the orientation of the book is judged by referring to the orientation of an image of only one page in accordance with the obtained image data. Therefore, it has drawbacks that an error occurs when the respective orientations of two pages on a spread are different and when the orientation of one page cannot be determined.
The first object of the present invention is to provide a document orientation recognizing device which can recognize the orientation of an image of a document at light load without reducing the reliability of a recognition result.
The second object of the present invention is to provide a document orientation recognizing device which can reliably recognize the orientation of an image of a page from a bound document.
The first object of the present invention can be achieved by a document orientation recognizing device which recognizes an orientation of an image of a document in accordance with a set of image data of the document, the document orientation recognizing device being made up of: a dividing unit which divides the set of image data into a plurality of data blocks, each data block corresponding to a different area obtained by dividing the image of the document; a reliability calculating unit which calculates a reliability for each data block for a case where a set of image data of the data block is used in an orientation recognition of the image of the document; a selecting unit which selects at least one data block whose reliability is higher than other data blocks in accordance with the reliability calculated for each data block by the reliability calculating unit; and a recognizing unit which recognizes the orientation of the image of the document in accordance with each set of image data of the at least one data block selected by the selecting unit.
With this construction, the reliability is calculated for each set of image data of divided data blocks for a case where the set of image data is used in orientation recognition of the image of the document. At least one data block whose reliability is higher than other data blocks is selected, and the orientation of the document is judged in accordance with the orientation detected from the selected data block(s). This allows the orientation recognition to be speedily and reliably executed.
When more than one data block whose reliability is higher than other data blocks is selected, the orientation is detected for each image of these selected data blocks. When the orientations are identical to each other, the identical orientation is judged as the orientation of the image of the document. By doing so, precision of the orientation recognition is increased.
The second object of the present invention can be achieved by a document orientation recognizing device made up of: a receiving unit which receives two sets of image data associated with first and second pages of a double-page spread; and a recognizing unit which recognizes an orientation of an image of the first page in accordance with the set of image data associated with the first page, and recognizes an orientation of an image of the second page in accordance with the set of image data associated with the second page.
With this construction, the orientation is recognized for each page on a double-page spread.
It is quite likely that the orientations of images of two pages (the first and second pages) on a double-page spread are identical to each other. For this reason, when it is impractical to detect the orientation of the image of the first page, the orientation of the image of the second page may be regarded as the orientation of the first page as well.
The reliability is obtained for each set of image data of the two pages on the spread for a case where the set of image data is used in orientation recognition of the image of the corresponding page. From the reliability, it is judged for each page whether the orientation recognition to be performed is practical or impractical.
The reliability can be obtained by generating a histogram from a target set of image data and executing a calculation using a difference of the max and min values of the histogram or using the number of rising points and the number of falling points of the histogram. Here, a rising point refers to a turning point where the present value increases from the previous value, and a falling point refers to a turning point where the present value decreases from the previous value.